package com.zhida.smartcontrol.dialog;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.jay.tools.base.BaseDialogFragment;
import com.zhida.smartcontrol.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * author: tanjianpei
 * date: 2019/10/9 009 16:33
 * description: 删除失败
 */
public class DelFailedDialogFragment extends BaseDialogFragment {
    @BindView(R.id.tv_msg)
    TextView mTvMsg;

    public static DelFailedDialogFragment newInstance(String msg) {
        Bundle args = new Bundle();
        args.putString("msg", msg);
        DelFailedDialogFragment fragment = new DelFailedDialogFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected Object getLayout() {
        return R.layout.dialog_del_failed;
    }

    @Override
    protected void initDatas(Bundle savedInstanceState) {
        Bundle bundle = getArguments();
        if (null == bundle || TextUtils.isEmpty(bundle.getString("msg"))) {
            return;
        }
        mTvMsg.setText(bundle.getString("msg"));
    }

    @OnClick({R.id.btn_know})
    public void click(View v) {
        dismiss();
    }

}
